package com.itheima.sh.f_ajax_json_test_06;

public class Result {
    private boolean flag; //执行结果
    private String message; //结果信息
    private Object valueData; //返回数据，增删改没有返回

    public Result() {
    }

    // 查询成功，满参构造
    public Result(boolean flag, String message, Object valueData) {
        this.flag = flag;
        this.message = message;
        this.valueData = valueData;
    }

    //增删改，或者查询失败，不需要valueData
    public Result(boolean flag, String message) {
        this.flag = flag;
        this.message = message;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getValueData() {
        return valueData;
    }

    public void setValueData(Object valueData) {
        this.valueData = valueData;
    }

    @Override
    public String toString() {
        return "Result{" +
                "flag=" + flag +
                ", message='" + message + '\'' +
                ", valueData=" + valueData +
                '}';
    }
}
